package com.gms.handle;/*
@author jianghai
@data 2021 - 23:41
*/

import com.baomidou.mybatisplus.core.handlers.MetaObjectHandler;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.reflection.MetaObject;
import org.springframework.stereotype.Component;

import java.util.Date;

@Slf4j
@Component
public class MyHandler implements MetaObjectHandler {
    @Override
    public void insertFill(MetaObject metaObject) {
        log.info("start insert fill");
        this.setFieldValByName("borrowTime",new Date(),metaObject);
        //this.setFieldValByName("receiveTime", new Date(), metaObject);
        this.setFieldValByName(  "repairtime",new Date(),metaObject);
    }

    @Override
    public void updateFill(MetaObject metaObject) {
        log.info("start insert fill");
        //this.setFieldValByName("updatetime",new Date(),metaObject);
    }
}
